package com.wc.算法基础课.D第四讲数学知识.博弈论.Nim游戏;

/**
 * @Author congge
 * @Date 2024/4/16 16:44
 * @description
 */

import java.util.*;

public class Main2 {
    static Scanner sc = new Scanner(System.in);
    static int N = 10010;
    static int[] f = new int[N];
    static int T, n, u;

    public static void main(String[] args) {
        T = sc.nextInt();
        Arrays.fill(f, -1);
        sg(10000);
        while (T-- > 0) {
            n = sc.nextInt();
            int res = 0;
            while (n-- > 0) {
                u = sc.nextInt();
                res ^= u;
            }
            if (res > 0) System.out.println("Yes");
            else System.out.println("No");
        }
    }

    static int sg(int u) {
        if (f[u] != -1) return f[u];
        Set<Integer> set = new HashSet<>();
        for (int i = u; i >= 1; i--) {
            set.add(sg(u - i));
        }

        for (int i = 0; ; i++) {
            if (!set.contains(i)) {
                f[u] = i;
                break;
            }
        }
        return f[u];
    }
}
